import React from 'react';
import { Modal } from 'antd';
import './index.scss';

class EditModal extends React.PureComponent {
  constructor(props) {
    super(props);

    this.state = {
      visible: false,
      loading: false,
    };
    this.showModal = ::this.showModal;
  }

  showModal() {
    this.setState({
      visible: true,
    });
  }
  close() {
    const { handModalCancel } = this.props;
    this.setState({
      loading: false,
      visible: false,
    }, handModalCancel && handModalCancel());
  }

  handleOk() {
    const { handleModalOk } = this.props;
    this.setState({
      visible: false,
    }, handleModalOk && handleModalOk());
  }

  render() {
    return (
      <div>
        <Modal
          className="video-new-modal"
          title="新消息"
          visible={this.state.visible}
          onOk={this.handleOk.bind(this)}
          onCancel={this.close.bind(this)}
          confirmLoading={this.state.loading}
          width={798}
          maskClosable={false}
        >
          <div className="content">
            您有一个新的来自于机器人的视频请求，是否同意连接？
          </div>
        </Modal>
      </div>
    );
  }
}

export default EditModal;
